export type EmotionType = 'positive' | 'negative' | 'neutral';
export type ConfidenceLevel = 'high' | 'medium' | 'low';
export type RiskEvaluation = 'high' | 'medium' | 'low';
export type TimeFrame = 'short' | 'medium' | 'long';
export type Alignment = 'aligned' | 'neutral' | 'conflicting';
export type Severity = 'high' | 'medium' | 'low';
export type ActionType = '保持开放和理解的态度' | '倾听对方感受' | '避免过度情绪化';
export type MeasureType = '定期进行深入交流' | '建立共同目标' | '培养同理心';

export interface Emotion {
  type: EmotionType;
  intensity: number;
  confidence: ConfidenceLevel;
  relativeIntensity: number;
}

export interface DialogueTurn {
  turn: number;
  speaker: string;
  text: string;
  subText?: string;
  emotion: Emotion;
}

export interface NetworkNode {
  id: string;
  label: string;
  type: 'goal' | 'evidence';
  weight: number;
  user: string;
  x?: number;
  y?: number;
  fx?: number | null;
  fy?: number | null;
}

export interface NetworkLink {
  source: string;
  target: string;
  strength: number;
  type: 'supports' | 'conflicts';
}

export interface CriticalJunction {
  turn: number;
  description: string;
  impact: string;
  triggers: string[];
  impactScore: number;
}

export interface DetectedIssue {
  issue: string;
  severity: Severity;
  participants: string[];
  type: string;
  evidence: string[];
  confidence: ConfidenceLevel;
}

export interface ImmediateAction {
  action: string;
  priority: Severity;
  impact: string;
  strategy: ActionType;
  example: string;
  applicability: number;
}

export interface PreventiveMeasure {
  measure: string;
  timeframe: TimeFrame;
  effectiveness: number;
  method: MeasureType;
  example: string;
  priority: Severity;
}

export interface MotivationGoal {
  goal: string;
  confidence: ConfidenceLevel;
  alignment: Alignment;
  supportingEvidence: string[];
}

export interface ConversationMessage {
  role: 'user' | 'assistant' | 'error';
  content: string;
  timestamp: string;
}

export interface AnalysisResult {
  reportId: string;
  contextSummary: {
    participants: string[];
    dialogueType: string;
    participantNames?: Record<string, string>;
  };
  interactionAnalysis: {
    emotionalTimeline: DialogueTurn[];
    pragmaticFeatures: string[];
  };
  strategicInsights: {
    motivationMatrix: Record<string, MotivationGoal[]>;
    criticalJunctions: CriticalJunction[];
  };
  conflictAssessment: {
    detectedIssues: DetectedIssue[];
    riskEvaluation: RiskEvaluation;
  };
  optimizationRecommendations: {
    immediateActions: ImmediateAction[];
    preventiveMeasures: PreventiveMeasure[];
  };
}
